import config from "@/config"
import http from "@/utils/request"

export default {
    list: {
        url: `${config.API_URL}/api/auth/task/list`,
        name: "分页获取任务列表",
        get: async function (params = {}) {
            return await http.get(this.url, params);
        }
    },
    create: {
        url: `${config.API_URL}/api/auth/task/create`,
        name: "创建任务",
        post: async function (data = {}) {
            return await http.post(this.url, data);
        }
    },
    update: {
        url: `${config.API_URL}/api/auth/task/update`,
        name: "更新任务",
        post: async function (data = {}) {
            return await http.post(this.url, data);
        }
    },
    del: {
        url: `${config.API_URL}/api/auth/task/delete`,
        name: "删除任务",
        get: async function (params = {}) {
            return await http.get(this.url, params);
        }
    },
    run: {
        url: `${config.API_URL}/api/auth/task/run/one`,
        name: "运行一次任务",
        get: async function (params = {}) {
            return await http.get(this.url, params);
        }
    },
}